package com.ebt.m.proposal_v2.widget.dialog;

import android.view.Gravity;
import android.widget.TextView;

import com.ebt.m.R;
import com.ebt.m.proposal_v2.helper.ThemeHelper;

/**
 * 确认窗口
 *
 * @author archer.qi
 *         Created on 2017/5/18.
 */
public class EBTConfirmDialog extends EBTDialogBase {

    private TextView messageView;
    private String msg;

    @Override
    public void init() {
        hideTitle();
        messageView = generateTextView();
        messageView.setBackgroundResource(R.drawable.bg_dialog_header_white);
        if (msg != null) {
            messageView.setText(msg);
        }
        addDialogBody(messageView);
    }

    private TextView generateTextView() {
        TextView view = new TextView(getActivity());
        view.setPadding(32, 60, 32, 60);
        view.setTextColor(ThemeHelper.getColor(getActivity(), R.color.PrimaryContentColor));
        view.setTextSize(16);
        view.setGravity(Gravity.CENTER);
        return view;
    }

    public void setMessage(String s) {
        msg = s;
    }
}
